package com.goddess.yeecolor.activity;

import android.os.Bundle;
import android.support.annotation.Nullable;
import android.support.v7.widget.Toolbar;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;

import com.goddess.yeecolor.R;
import com.goddess.yeecolor.base.BaseActivity;
import com.goddess.yeecolor.tools.JumpIntents;

/**
 * 我要报名
 */
public class StartEnrollActivity extends BaseActivity{
    private EditText start_name,start_phone,start_company,start_post,start_wx;
    private String name,phone,company,post,wx;
    private Button btn_enroll;
    private Toolbar mToobar;
    private TextView mTitle,start_rule;
    private View mView;
    @Override
    public void onCreate(@Nullable Bundle savedInstanceState) {
        setTheme(R.style.AppTheme);
        super.onCreate(savedInstanceState);
        mView= LayoutInflater.from(this).inflate(R.layout.activity_startenroll,null);
        setContentView(mView);
        initFindView();
        initOnClck();
    }

    @Override
    public void initOnClck() {
        btn_enroll.setOnClickListener((view)->{
            //获取每一行数据
            initData();
            JumpIntents.startIntent(this,EnrollFinishAcitity.class);
        });
    }

    @Override
    public void initFindView() {
        mToobar= (Toolbar) findViewById(R.id.title_toobar);
        mTitle= (TextView) findViewById(R.id.title_content);
        start_name= (EditText) findViewById(R.id.start_name);
        start_phone= (EditText) findViewById(R.id.start_phone);
        start_company= (EditText) findViewById(R.id.start_company);
        start_post= (EditText) findViewById(R.id.start_post);
        start_wx= (EditText) findViewById(R.id.start_wx);
        start_rule= (TextView) findViewById(R.id.start_rule);
        btn_enroll= (Button) findViewById(R.id.btn_enroll);
        mTitle.setText("我要报名");
//        setSupportActionBar(mToobar);
//        getSupportActionBar().setDisplayShowTitleEnabled(false);
        mToobar.setNavigationIcon(R.mipmap.back3x);
        mToobar.setNavigationOnClickListener((view)->{
            setFiish(this);
        });
    }

    @Override
    public void initData() {
        name=start_name.getText().toString().trim();
        phone=start_phone.getText().toString().trim();
        company=start_company.getText().toString().trim();
        post=start_post.getText().toString().trim();
        wx=start_wx.getText().toString().trim();
    }

    @Override
    public void onBackPressed() {
        super.onBackPressed();
        finish();
        overridePendingTransition(0,0);
    }
}
